-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: rename search_and_replace tool to edit and unify edit-family UI #11296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hannesrudolph
wants to merge
11
commits into
main
Choose a base branch
from
feat/rename-search-and-replace-to-edit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
All previously flagged issues are now resolved. No new issues in latest commit.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
01335c6 to
0a1377c
Compare
52ad6f3 to
285a161
Compare
…ture - Add new 'edit' tool with file_path, old_string, new_string, replace_all params - Keep search_and_replace as backward-compatible alias via TOOL_ALIASES - Create EditTool execution handler with replace_all and uniqueness checking - Update NativeToolCallParser for both edit and search_and_replace names - Update presentAssistantMessage routing for both tool names - Add alias resolution to isToolAllowedForMode for customTools validation - Reduce SearchAndReplaceTool.ts to re-export wrapper from EditTool - Add 16 new EditTool tests, update searchAndReplaceTool tests - MiniMax includedTools: ['search_and_replace'] continues to work via alias
- route edit/search/patch-related tool events through the appliedDiff chat UI branch - ensure apply_patch partial rows emit a deterministic non-empty path - add apply_patch partial regression tests - expand ChatRow diff-actions tests for unified behavior
09a6b8a to
793be28
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Renames the
search_and_replacetool toeditwith a new flat parameter structure (file_path,old_string,new_string,replace_all), replacing the old batch operations array. Keepssearch_and_replaceas a backward-compatible alias so models like MiniMax that reference it inincludedToolscontinue to work without changes.Changes
edittool definition (src/core/prompts/tools/native-tools/edit.ts) withfile_path,old_string,new_string,replace_allparametersEditToolexecution handler (src/core/tools/EditTool.ts) withreplace_allsupport and uniqueness checkingsearch_and_replace: "edit"toTOOL_ALIASES— models withincludedTools: ["search_and_replace"](e.g., MiniMax) get theedittool renamed assearch_and_replaceNativeToolCallParser.tshandles both"edit"and"search_and_replace"tool names with the new parameter structurepresentAssistantMessage.tsroutes both tool names toEditToolisToolAllowedForModenow resolves aliases when checking customTools, ensuringsearch_and_replaceinincludedToolscorrectly maps toeditSearchAndReplaceTool.tsreduced to a 2-line re-export fromEditTool"edit"totoolNames,"replace_all"totoolParamNames, updatedNativeToolArgsTest Results
src/suite: 341 passed (29 pre-existing failures from missing@ai-sdk/amazon-bedrock— unrelated)packages/types: 170/170 passingImportant
Renames
search_and_replacetool toedit, updates parameters, maintains backward compatibility, and unifies edit-related UI.search_and_replacetool toeditwith new parameters:file_path,old_string,new_string,replace_all.search_and_replaceas an alias for backward compatibility.ChatRow.tsx.edit.tsfor new tool definition.EditTool.tsto handle new parameters and logic.search_and_replace.ts, re-exportingEditToolasSearchAndReplaceTool.validateToolUse.tsto resolve tool aliases.EditToolineditTool.spec.ts.ChatRow.diff-actions.spec.tsxto test unified UI behavior.searchAndReplaceTool.spec.tstests, keeping alias verification.This description was created by
for 6b7b715. You can customize this summary. It will automatically update as commits are pushed.
Additional updates in latest commits
searchAndReplace,search_and_replace,search_replace,edit,edit_file,apply_patch, and related edit-result events render through the sameappliedDiffbranch.apply_patchpartial preview payloads to emit a deterministic non-empty path, eliminating blank initial approval rows and aligning early UX withapply_diff.apply_patchpartial path extraction and unified chat diff-actions rendering.